//
//  DataCacheManager.h
//  轻量级缓存管理器，利用UserDefault进行缓存管理，大数据量是效率有问题
//
//  Created by lian jie on 6/8/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

#define UD_KEY_DATA_CACHE_KEYS @"UD_KEY_DATA_CACHE_KEYS"

typedef enum : NSUInteger{
	DataCacheManagerCacheTypeMemory,
	DataCacheManagerCacheTypePersist
} DataCacheManagerCacheType;

@interface DataCacheManager : NSObject
{

}

+ (DataCacheManager *)sharedManager;

- (BOOL)hasObjectInCacheByKey:(NSString*)key;

- (NSObject*)getCachedObjectByKey:(NSString*)key;

- (void)clearAllCache;
- (void)clearAllDiskCache;
- (void)clearMemoryCache;
- (void)addObject:(NSObject*)obj forKey:(NSString*)key;
- (void)addObjectToMemory:(NSObject*)obj forKey:(NSString*)key;
- (void)removeObjectInCacheByKey:(NSString*)key;
- (void)doSave;

@end
